using System;
using System.Collections.Generic;
using System.Text;
using emp.Model.SysManage;
using emp.IDAL.SysManage;
using System.Collections;

namespace emp.BLL.SysManage
{
    public class PrivilegeKey
    {
        public int Insert(PrivilegeKeyInfo keyInfo)
        {
            if (keyInfo.KeyName.Trim() == string.Empty)
            {
                return 0;
            }
            IPrivilegeKey dal = DALFactory.SysManage.PrivilegeKey.Create();
            return dal.Insert(keyInfo);
        }

        public int Update(PrivilegeKeyInfo keyInfo)
        {

            if (keyInfo.KeyName.Trim() == string.Empty)
            {
                return 0;
            }

            IPrivilegeKey dal = DALFactory.SysManage.PrivilegeKey.Create();

            return dal.Update(keyInfo);
        }

        public int Delete(int iKeyID)
        {

            IPrivilegeKey dal = DALFactory.SysManage.PrivilegeKey.Create();
            return dal.Delete(iKeyID);
        }

        public IList getKeyList()
        {
            IPrivilegeKey dal = DALFactory.SysManage.PrivilegeKey.Create();

            return dal.getKeyList();
        }

        public IList getKeyInfo(int iKeyID)
        {
            IPrivilegeKey dal = DALFactory.SysManage.PrivilegeKey.Create();
            return dal.getKeyInfo(iKeyID);
        }
    }
}
